#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include <Windows.h>
#include <vector>

using namespace std;

LPDIRECT3DDEVICE9 GetDevice9();
HWND GetHwnd();
float GetBackBufferWidth();
float GetBackBufferHeight();


class cCamera;
cCamera* GetCamera();
D3DXMATRIX GetViewProj();
D3DXMATRIX GetView();
D3DXMATRIX GetProj();

class cFontMgr;
cFontMgr* GetFontMgr();

class cShaderMgr;
cShaderMgr* GetShaderMgr();

class cTextureMgr;
cTextureMgr* GetTextureMgr();

class cHeightmapMgr;
cHeightmapMgr* GetHeightmapMgr();

class cModelMgr;
cModelMgr* GetModelMgr();

class cLuaMgr;
cLuaMgr* GetLuaMgr();

class cLight;
cLight* GetLight();

class cMd5Viewer;
cMd5Viewer* GetMd5Viewer();



// input
bool GetMouseState(UINT mouse);
SHORT GetMouseX();
SHORT GetMouseY();

//mouse enum
enum Mouse{
	LEFT,
	MIDDLE,
	RIGHT,
};

//get terrain height
class cTerrainBase;
class cTerrainBuilder;

float GetTerrainHeight( float x, float z);
vector<cTerrainBase*>& GetVisibleTerrainTile();


//intersect
bool GetIntersectVec3( ID3DXMesh* pMesh, D3DXVECTOR3& intersectVec3 );

